import 'package:flutter/material.dart';

class DemoTabBarView extends StatelessWidget {
  const DemoTabBarView({super.key});

  @override
  Widget build(BuildContext context) {
    return DefaultTabController(
      length: 2,
      child: Scaffold(
        appBar: AppBar(
          backgroundColor: Colors.limeAccent,
          bottom: TabBar(tabs: [
            Tab(
              text: '1',
            ),
            Tab(
              text: '2',
            )
          ]),
        ),
        body: Stack(
          children: [
            TabBarView(
              children: [
                Container(
                  color: Colors.red,
                ),
                Container(
                  color: Colors.blue,
                ),
              ],
            ),
          ],
        ),
      ),
    );
  }
}
